package cn.txy.system.vo;

import cn.txy.system.domain.Employee;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Data
public class EmployeeVo {
    private Long id;
    private String username;
    private String phone;
    private String email;
    private Integer age;
    private Boolean state;
    private List<Long> roles;

    public static Employee of(EmployeeVo employeeVo) {
        Employee employee = new Employee();
        BeanUtils.copyProperties(employeeVo, employee);
        employee.setState(employeeVo.getState()?1:0);
        return employee;
    }
}
